import Request from '../common/js/request'

class MyApply {
  /**
   * 查询当前用户开启的流程
   * @param pageNum 当前页数
   * @param pageSize 每页条数
   */
  static getUserStartProcessList(pageNum, pageSize, form) {
    const url = '/api-workflow/history/getUserStartProcessList'

    const data = {
      pageNum: pageNum - 1,
      pageSize,
      ...form
    }

    return Request.get(url, data)
  }

  /**
   * 获取流程详情
   * @param processDefinitionId 流程定义Id
   * @param processInstanceId 流程实例Id
   */
  static getProcessDetails(processDefinitionId, processInstanceId) {
    const url = '/api-workflow/runtime/getProcessDetails'

    const data = {
      processDefinitionId,
      processInstanceId
    }

    return Request.get(url, data)
  }
}

export default MyApply
